﻿Public Class Frm_Tanbih

    Dim screenSize As Integer = Screen.PrimaryScreen.Bounds.Height - Screen.PrimaryScreen.WorkingArea.Height
    Dim positionFinal As Integer = My.Computer.Screen.Bounds.Height - 232 - screenSize

    Private Sub Frm_Tanbih_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        'Frm_Main.ShowTimer.Interval = 1000
        Me.Location = New Point(My.Computer.Screen.Bounds.Width - Me.Width, My.Computer.Screen.Bounds.Height)
        My.Computer.Audio.Play(My.Resources.Alert, AudioPlayMode.Background)
        Dim i As Integer = 0
        Dim numDossier As String = ""
        For Each ligne As DataRow In Partager.ds.Tables(0).Rows
            If numDossier <> CStr(ligne("Num_dossier")) Then
                numDossier = CStr(ligne("Num_dossier"))
                i += 1
            End If
        Next
        Label1.Text = i & " جلسة غير مؤخرة"
        openTimer.Start()

    End Sub
    Private Sub openTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles openTimer.Tick
        If Me.Location.Y <= positionFinal Then
            openTimer.Stop()
            lifeTimer.Start()
        Else
            Me.Location = New Point(My.Computer.Screen.Bounds.Width - Me.Width, Me.Location.Y - 4)
        End If
    End Sub

    Private Sub closeTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles closeTimer.Tick
        If Me.Location.Y >= My.Computer.Screen.Bounds.Height Then
            closeTimer.Stop()
            lifeTimer.Stop()
            Me.Close()
        Else
            Me.Location = New Point(My.Computer.Screen.Bounds.Width - Me.Width, Me.Location.Y + 4)
        End If
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        closeTimer.Start()
        My.Computer.Audio.Stop()
    End Sub

    Private Sub lifeTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lifeTimer.Tick
        closeTimer.Start()
    End Sub

    Private Sub Btn_detail_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn_detail.Click
        My.Computer.Audio.Stop()
        Partager.StandardInitial()
        Partager.verifPriv(frmAlarmes)
    End Sub

End Class